<?php

namespace Xrfg\Wallet\USDT\Providers;

use Illuminate\Support\ServiceProvider as IlluminateServiceProvider;
use Xrfg\Wallet\USDT\Console\Recharge;

class ServiceProvider extends IlluminateServiceProvider
{
    public function boot()
    {
        $this->registerPublishing();
        $this->registerCommands();
    }

    public function register()
    {
        $this->mergeConfigFrom(
            __DIR__.'/../../config/usdt.php', 'wallet.usdt'
        );
    }

    private function registerPublishing()
    {
        if ($this->app->runningInConsole()) {
            $this->publishes([
                __DIR__.'/../../config/usdt.php' => config_path('wallet/usdt.php'),
            ]);
        }
    }

    private function registerCommands()
    {
        if ($this->app->runningInConsole()) {
            $this->commands([
                Recharge::class,
            ]);
        }
    }
}
